package com.xn.app.muying.adpter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.xn.app.muying.R;

import java.util.ArrayList;

/**
 * Created by Administrator on 2016/10/10.
 */
public class ItemInfoAdpter extends BaseAdapter{
    private Context context;
    private ArrayList<String> list;
    private LayoutInflater inflater;
    public ItemInfoAdpter(Context context, ArrayList<String> list) {
        this.context = context;
        this.list = list;
        inflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View view, ViewGroup viewGroup) {
        ViewHolderItemInfo holderItem = new ViewHolderItemInfo();

        view = inflater.inflate(R.layout.home_fragment_floor_item_info,null);
        holderItem.imageView =(ImageView)view.findViewById(R.id.imageView);
        holderItem.textView_title =(TextView) view.findViewById(R.id.textView_title);
        holderItem.textView_content =(TextView) view.findViewById(R.id.textView_content);

        holderItem.imageView.setImageResource(R.mipmap.ic_launcher);
        holderItem.textView_title.setText("怀孕优生五项需要查吗");
        holderItem.textView_content.setText("要想知道优生五项查不查，首先应该知道什么是优生五项，要想知道优生五项查不查，首先应该知道什么是优生五项要想知道优生五项查不查，首先应该知道什么是优生五项要想知道优生五项查不查，首先应该知道什么是优生五项");


        return view;
    }

    class ViewHolderItemInfo{
        ImageView imageView;
        TextView textView_title;
        TextView textView_content;
    }

}
